package com.superman.supermarket.client.view.storecouponlist;

import java.util.List;
import java.util.Map;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Widget;
import com.superman.mvpframe.client.mvp.IPageViewPresenter;
import com.superman.supermarket.client.composite.storecoupon.StoreCouponModule;

/**
 * 店铺优惠券列表ui实现类
 * 
 * @author superman
 * @version 2018年8月18日下午11:00:22
 */
public class StoreCouponListViewImpl extends Composite implements StoreCouponListView {

	interface StoreCouponListViewImplUiBinder extends UiBinder<Widget, StoreCouponListViewImpl> {
	}

	private static StoreCouponListViewImplUiBinder uiBinder = GWT.create(StoreCouponListViewImplUiBinder.class);

	@UiField
	FlowPanel listpanel;

	/**
	 * 构造方法
	 * 
	 * @author superman
	 * @version 2018年8月18日 下午11:00:25
	 */
	public StoreCouponListViewImpl() {
		initWidget(uiBinder.createAndBindUi(this));
	}

	@Override
	public void init() {
		// TODO Auto-generated method stub

	}

	@Override
	public void setList(List<Map<String, Object>> list) {
		listpanel.clear();
		for (Map<String, Object> map : list) {
			StoreCouponModule storeCouponModule = new StoreCouponModule();
			storeCouponModule.setData(map);
			this.listpanel.add(storeCouponModule);
		}
	}

	@Override
	public void setPageViewPresenter(IPageViewPresenter presenter) {
		// TODO Auto-generated method stub

	}

}
